package com.wkbb.sports.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class JumpGradeSummaryDto {

	@ApiModelProperty(value ="年级ID" )
	private Long gradeId;

	@ApiModelProperty(value ="男生优秀人数" )
	private Integer maleFine;
	
	@ApiModelProperty(value ="男生良好人数" )
	private Integer maleGood;
	
	@ApiModelProperty(value ="男生及格人数" )
	private Integer malePass;
	
	@ApiModelProperty(value ="男生不格人数" )
	private Integer maleFail;
	
	@ApiModelProperty(value ="女生优秀人数" )
	private Integer femaleFine;
	
	@ApiModelProperty(value ="女生良好人数" )
	private Integer femaleGood;
	
	@ApiModelProperty(value ="女生及格人数" )
	private Integer femalePass;
	
	@ApiModelProperty(value ="女生不及格人数" )
	private Integer femaleFail;

	@ApiModelProperty(value ="优秀人数" )
	public Integer getFine() {
		return maleFine + femaleFine;
	}

	@ApiModelProperty(value ="良好人数" )
	public Integer getGood() {
		return maleGood + femaleGood;
	}

	@ApiModelProperty(value ="及格人数" )
	public Integer getPass() {
		return malePass + femalePass;
	}

	@ApiModelProperty(value ="不及格人数" )
	public Integer getFail() {
		return maleFail + femaleFail;
	}

	@ApiModelProperty(value ="男生总人数" )
	public Integer getMaleTotal() {
		return maleFine + maleGood + malePass + maleFail;
	}

	@ApiModelProperty(value ="女生总人数" )
	public Integer getFemaleTotal() {
		return femaleFine + femaleGood + femalePass + femaleFail;
	}
	
	@ApiModelProperty(value ="男生优秀占比" )
	public Double getMaleFinePercent() {
		double total = getMaleTotal();
		if(total == 0) {
			return 0D;
		}
		return maleFine / total;
	}

	@ApiModelProperty(value ="男生良好占比" )
	public Double getMaleGoodPercent() {
		double total = getMaleTotal();
		if(total == 0) {
			return 0D;
		}
		return maleGood / total;
	}

	@ApiModelProperty(value ="男生及格占比" )
	public Double getMalePassPercent() {
		double total = getMaleTotal();
		if(total == 0) {
			return 0D;
		}
		return malePass / total;
	}

	@ApiModelProperty(value ="男生不及格占比" )
	public Double getMaleFailPercent() {
		double total = getMaleTotal();
		if(total == 0) {
			return 0D;
		}
		return maleFail / total;
	}

	@ApiModelProperty(value ="女生优秀占比" )
	public Double getFemaleFinePercent() {
		double total = getFemaleTotal();
		if(total == 0) {
			return 0D;
		}
		return femaleFine / total;
	}

	@ApiModelProperty(value ="女生良好占比" )
	public Double getFemaleGoodPercent() {
		double total = getFemaleTotal();
		if(total == 0) {
			return 0D;
		}
		return femaleGood / total;
	}

	@ApiModelProperty(value ="女生及格占比" )
	public Double getFemalePassPercent() {
		double total = getFemaleTotal();
		if(total == 0) {
			return 0D;
		}
		return femalePass / total;
	}

	@ApiModelProperty(value ="女生不及格占比" )
	public Double getFemaleFailPercent() {
		double total = getFemaleTotal();
		if(total == 0) {
			return 0D;
		}
		return femaleFail / total;
	}

	@ApiModelProperty(value ="优秀占比" )
	public Double getFinePercent() {
		double total = getMaleTotal() + getFemaleTotal();
		if(total == 0) {
			return 0D;
		}
		return (maleFine + femaleFine) / total;
	}

	@ApiModelProperty(value ="良好占比" )
	public Double getGoodPercent() {
		double total = getMaleTotal() + getFemaleTotal();
		if(total == 0) {
			return 0D;
		}
		return (maleGood + femaleGood) / total;
	}

	@ApiModelProperty(value ="及格占比" )
	public Double getPassPercent() {
		double total = getMaleTotal() + getFemaleTotal();
		if(total == 0) {
			return 0D;
		}
		return (malePass + femalePass) / total;
	}

	@ApiModelProperty(value ="不及格占比" )
	public Double getFailPercent() {
		double total = getMaleTotal() + getFemaleTotal();
		if(total == 0) {
			return 0D;
		}
		return (maleFail + femaleFail) / total;
	}
}
